﻿using System;
using System.Data;
using System.Text;
using System.Data.OracleClient;
using ChinaSoft.DBUtility;//Please add references
namespace ChinaSoft.DAL
{
	/// <summary>
	/// 数据访问类:DAL_T_PET_PETINFO
	/// </summary>
	public partial class DAL_T_PET_PETINFO
	{
		public DAL_T_PET_PETINFO()
		{}
		#region  Method



		/// <summary>
		/// 增加一条数据
		/// </summary>
		public bool Add(ChinaSoft.Model.Model_T_PET_PETINFO model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("insert into T_PET_PETINFO(");
			strSql.Append("PET_PETINFO_ID,PERMISSION_NO,AREA_GRADE,RFID_DATE,USE_TYPE,COLOR_ID,BREED_ID,FATHER_BREED,MOTHER_BREED,OWNER_ID,AREA_ID,CERT_ORG_ID,BIRTHDAY,CERT_DATE,CHARACTER,HEIGHT,IMMUNITY_NO,IMPORT_ADDRESS,NAME,NOTE,OWNER_TYPE,PET_NO,REG_ORG_ID,RFID,SEX,STATE,TYPE,WEIGHT,REGISTER_NO,ADDRESS,CREATE_TIME,CREATOR_ID,UPDATE_TIME,UPDATOR_ID,PETIMAGE_ID,REGISTER_ID,ISLOGOUT,POLICE_STATION,PETAGE)");
			strSql.Append(" values (");
			strSql.Append(":PET_PETINFO_ID,:PERMISSION_NO,:AREA_GRADE,:RFID_DATE,:USE_TYPE,:COLOR_ID,:BREED_ID,:FATHER_BREED,:MOTHER_BREED,:OWNER_ID,:AREA_ID,:CERT_ORG_ID,:BIRTHDAY,:CERT_DATE,:CHARACTER,:HEIGHT,:IMMUNITY_NO,:IMPORT_ADDRESS,:NAME,:NOTE,:OWNER_TYPE,:PET_NO,:REG_ORG_ID,:RFID,:SEX,:STATE,:TYPE,:WEIGHT,:REGISTER_NO,:ADDRESS,:CREATE_TIME,:CREATOR_ID,:UPDATE_TIME,:UPDATOR_ID,:PETIMAGE_ID,:REGISTER_ID,:ISLOGOUT,:POLICE_STATION,:PETAGE)");
			OracleParameter[] parameters = {
					new OracleParameter(":PET_PETINFO_ID", OracleType.VarChar,40),
					new OracleParameter(":PERMISSION_NO", OracleType.NVarChar),
					new OracleParameter(":AREA_GRADE", OracleType.Number,19),
					new OracleParameter(":RFID_DATE", OracleType.DateTime),
					new OracleParameter(":USE_TYPE", OracleType.NVarChar),
					new OracleParameter(":COLOR_ID", OracleType.VarChar,40),
					new OracleParameter(":BREED_ID", OracleType.VarChar,40),
					new OracleParameter(":FATHER_BREED", OracleType.Number,19),
					new OracleParameter(":MOTHER_BREED", OracleType.Number,19),
					new OracleParameter(":OWNER_ID", OracleType.VarChar,40),
					new OracleParameter(":AREA_ID", OracleType.VarChar,40),
					new OracleParameter(":CERT_ORG_ID", OracleType.VarChar,40),
					new OracleParameter(":BIRTHDAY", OracleType.DateTime),
					new OracleParameter(":CERT_DATE", OracleType.DateTime),
					new OracleParameter(":CHARACTER", OracleType.NVarChar),
					new OracleParameter(":HEIGHT", OracleType.Number,19),
					new OracleParameter(":IMMUNITY_NO", OracleType.NVarChar),
					new OracleParameter(":IMPORT_ADDRESS", OracleType.NVarChar),
					new OracleParameter(":NAME", OracleType.NVarChar),
					new OracleParameter(":NOTE", OracleType.NVarChar),
					new OracleParameter(":OWNER_TYPE", OracleType.NVarChar),
					new OracleParameter(":PET_NO", OracleType.NVarChar),
					new OracleParameter(":REG_ORG_ID", OracleType.VarChar,40),
					new OracleParameter(":RFID", OracleType.NVarChar),
					new OracleParameter(":SEX", OracleType.NVarChar),
					new OracleParameter(":STATE", OracleType.NVarChar),
					new OracleParameter(":TYPE", OracleType.Number,10),
					new OracleParameter(":WEIGHT", OracleType.Number,19),
					new OracleParameter(":REGISTER_NO", OracleType.NVarChar),
					new OracleParameter(":ADDRESS", OracleType.NVarChar),
					new OracleParameter(":CREATE_TIME", OracleType.DateTime),
					new OracleParameter(":CREATOR_ID", OracleType.VarChar,40),
					new OracleParameter(":UPDATE_TIME", OracleType.DateTime),
					new OracleParameter(":UPDATOR_ID", OracleType.VarChar,40),
					new OracleParameter(":PETIMAGE_ID", OracleType.NVarChar),
					new OracleParameter(":REGISTER_ID", OracleType.VarChar,40),
					new OracleParameter(":ISLOGOUT", OracleType.Number,10),
					new OracleParameter(":POLICE_STATION", OracleType.VarChar,200),
					new OracleParameter(":PETAGE", OracleType.Float,22)};
			parameters[0].Value = model.PET_PETINFO_ID;
			parameters[1].Value = model.PERMISSION_NO;
			parameters[2].Value = model.AREA_GRADE;
			parameters[3].Value = model.RFID_DATE;
			parameters[4].Value = model.USE_TYPE;
			parameters[5].Value = model.COLOR_ID;
			parameters[6].Value = model.BREED_ID;
			parameters[7].Value = model.FATHER_BREED;
			parameters[8].Value = model.MOTHER_BREED;
			parameters[9].Value = model.OWNER_ID;
			parameters[10].Value = model.AREA_ID;
			parameters[11].Value = model.CERT_ORG_ID;
			parameters[12].Value = model.BIRTHDAY;
			parameters[13].Value = model.CERT_DATE;
			parameters[14].Value = model.CHARACTER;
			parameters[15].Value = model.HEIGHT;
			parameters[16].Value = model.IMMUNITY_NO;
			parameters[17].Value = model.IMPORT_ADDRESS;
			parameters[18].Value = model.NAME;
			parameters[19].Value = model.NOTE;
			parameters[20].Value = model.OWNER_TYPE;
			parameters[21].Value = model.PET_NO;
			parameters[22].Value = model.REG_ORG_ID;
			parameters[23].Value = model.RFID;
			parameters[24].Value = model.SEX;
			parameters[25].Value = model.STATE;
			parameters[26].Value = model.TYPE;
			parameters[27].Value = model.WEIGHT;
			parameters[28].Value = model.REGISTER_NO;
			parameters[29].Value = model.ADDRESS;
			parameters[30].Value = model.CREATE_TIME;
			parameters[31].Value = model.CREATOR_ID;
			parameters[32].Value = model.UPDATE_TIME;
			parameters[33].Value = model.UPDATOR_ID;
			parameters[34].Value = model.PETIMAGE_ID;
			parameters[35].Value = model.REGISTER_ID;
			parameters[36].Value = model.ISLOGOUT;
			parameters[37].Value = model.POLICE_STATION;
			parameters[38].Value = model.PETAGE;

			int rows=DbHelperOra.ExecuteSql(strSql.ToString(),parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
		/// <summary>
		/// 更新一条数据
		/// </summary>
		public bool Update(ChinaSoft.Model.Model_T_PET_PETINFO model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("update T_PET_PETINFO set ");
			strSql.Append("PET_PETINFO_ID=:PET_PETINFO_ID,");
			strSql.Append("PERMISSION_NO=:PERMISSION_NO,");
			strSql.Append("AREA_GRADE=:AREA_GRADE,");
			strSql.Append("RFID_DATE=:RFID_DATE,");
			strSql.Append("USE_TYPE=:USE_TYPE,");
			strSql.Append("COLOR_ID=:COLOR_ID,");
			strSql.Append("BREED_ID=:BREED_ID,");
			strSql.Append("FATHER_BREED=:FATHER_BREED,");
			strSql.Append("MOTHER_BREED=:MOTHER_BREED,");
			strSql.Append("OWNER_ID=:OWNER_ID,");
			strSql.Append("AREA_ID=:AREA_ID,");
			strSql.Append("CERT_ORG_ID=:CERT_ORG_ID,");
			strSql.Append("BIRTHDAY=:BIRTHDAY,");
			strSql.Append("CERT_DATE=:CERT_DATE,");
			strSql.Append("CHARACTER=:CHARACTER,");
			strSql.Append("HEIGHT=:HEIGHT,");
			strSql.Append("IMMUNITY_NO=:IMMUNITY_NO,");
			strSql.Append("IMPORT_ADDRESS=:IMPORT_ADDRESS,");
			strSql.Append("NAME=:NAME,");
			strSql.Append("NOTE=:NOTE,");
			strSql.Append("OWNER_TYPE=:OWNER_TYPE,");
			strSql.Append("PET_NO=:PET_NO,");
			strSql.Append("REG_ORG_ID=:REG_ORG_ID,");
			strSql.Append("RFID=:RFID,");
			strSql.Append("SEX=:SEX,");
			strSql.Append("STATE=:STATE,");
			strSql.Append("TYPE=:TYPE,");
			strSql.Append("WEIGHT=:WEIGHT,");
			strSql.Append("REGISTER_NO=:REGISTER_NO,");
			strSql.Append("ADDRESS=:ADDRESS,");
			strSql.Append("CREATE_TIME=:CREATE_TIME,");
			strSql.Append("CREATOR_ID=:CREATOR_ID,");
			strSql.Append("UPDATE_TIME=:UPDATE_TIME,");
			strSql.Append("UPDATOR_ID=:UPDATOR_ID,");
			strSql.Append("PETIMAGE_ID=:PETIMAGE_ID,");
			strSql.Append("REGISTER_ID=:REGISTER_ID,");
			strSql.Append("ISLOGOUT=:ISLOGOUT,");
			strSql.Append("POLICE_STATION=:POLICE_STATION,");
			strSql.Append("PETAGE=:PETAGE");
			strSql.Append(" where ");
			OracleParameter[] parameters = {
					new OracleParameter(":PET_PETINFO_ID", OracleType.VarChar,40),
					new OracleParameter(":PERMISSION_NO", OracleType.NVarChar),
					new OracleParameter(":AREA_GRADE", OracleType.Number,19),
					new OracleParameter(":RFID_DATE", OracleType.DateTime),
					new OracleParameter(":USE_TYPE", OracleType.NVarChar),
					new OracleParameter(":COLOR_ID", OracleType.VarChar,40),
					new OracleParameter(":BREED_ID", OracleType.VarChar,40),
					new OracleParameter(":FATHER_BREED", OracleType.Number,19),
					new OracleParameter(":MOTHER_BREED", OracleType.Number,19),
					new OracleParameter(":OWNER_ID", OracleType.VarChar,40),
					new OracleParameter(":AREA_ID", OracleType.VarChar,40),
					new OracleParameter(":CERT_ORG_ID", OracleType.VarChar,40),
					new OracleParameter(":BIRTHDAY", OracleType.DateTime),
					new OracleParameter(":CERT_DATE", OracleType.DateTime),
					new OracleParameter(":CHARACTER", OracleType.NVarChar),
					new OracleParameter(":HEIGHT", OracleType.Number,19),
					new OracleParameter(":IMMUNITY_NO", OracleType.NVarChar),
					new OracleParameter(":IMPORT_ADDRESS", OracleType.NVarChar),
					new OracleParameter(":NAME", OracleType.NVarChar),
					new OracleParameter(":NOTE", OracleType.NVarChar),
					new OracleParameter(":OWNER_TYPE", OracleType.NVarChar),
					new OracleParameter(":PET_NO", OracleType.NVarChar),
					new OracleParameter(":REG_ORG_ID", OracleType.VarChar,40),
					new OracleParameter(":RFID", OracleType.NVarChar),
					new OracleParameter(":SEX", OracleType.NVarChar),
					new OracleParameter(":STATE", OracleType.NVarChar),
					new OracleParameter(":TYPE", OracleType.Number,10),
					new OracleParameter(":WEIGHT", OracleType.Number,19),
					new OracleParameter(":REGISTER_NO", OracleType.NVarChar),
					new OracleParameter(":ADDRESS", OracleType.NVarChar),
					new OracleParameter(":CREATE_TIME", OracleType.DateTime),
					new OracleParameter(":CREATOR_ID", OracleType.VarChar,40),
					new OracleParameter(":UPDATE_TIME", OracleType.DateTime),
					new OracleParameter(":UPDATOR_ID", OracleType.VarChar,40),
					new OracleParameter(":PETIMAGE_ID", OracleType.NVarChar),
					new OracleParameter(":REGISTER_ID", OracleType.VarChar,40),
					new OracleParameter(":ISLOGOUT", OracleType.Number,10),
					new OracleParameter(":POLICE_STATION", OracleType.VarChar,200),
					new OracleParameter(":PETAGE", OracleType.Float,22)};
			parameters[0].Value = model.PET_PETINFO_ID;
			parameters[1].Value = model.PERMISSION_NO;
			parameters[2].Value = model.AREA_GRADE;
			parameters[3].Value = model.RFID_DATE;
			parameters[4].Value = model.USE_TYPE;
			parameters[5].Value = model.COLOR_ID;
			parameters[6].Value = model.BREED_ID;
			parameters[7].Value = model.FATHER_BREED;
			parameters[8].Value = model.MOTHER_BREED;
			parameters[9].Value = model.OWNER_ID;
			parameters[10].Value = model.AREA_ID;
			parameters[11].Value = model.CERT_ORG_ID;
			parameters[12].Value = model.BIRTHDAY;
			parameters[13].Value = model.CERT_DATE;
			parameters[14].Value = model.CHARACTER;
			parameters[15].Value = model.HEIGHT;
			parameters[16].Value = model.IMMUNITY_NO;
			parameters[17].Value = model.IMPORT_ADDRESS;
			parameters[18].Value = model.NAME;
			parameters[19].Value = model.NOTE;
			parameters[20].Value = model.OWNER_TYPE;
			parameters[21].Value = model.PET_NO;
			parameters[22].Value = model.REG_ORG_ID;
			parameters[23].Value = model.RFID;
			parameters[24].Value = model.SEX;
			parameters[25].Value = model.STATE;
			parameters[26].Value = model.TYPE;
			parameters[27].Value = model.WEIGHT;
			parameters[28].Value = model.REGISTER_NO;
			parameters[29].Value = model.ADDRESS;
			parameters[30].Value = model.CREATE_TIME;
			parameters[31].Value = model.CREATOR_ID;
			parameters[32].Value = model.UPDATE_TIME;
			parameters[33].Value = model.UPDATOR_ID;
			parameters[34].Value = model.PETIMAGE_ID;
			parameters[35].Value = model.REGISTER_ID;
			parameters[36].Value = model.ISLOGOUT;
			parameters[37].Value = model.POLICE_STATION;
			parameters[38].Value = model.PETAGE;

			int rows=DbHelperOra.ExecuteSql(strSql.ToString(),parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}

		/// <summary>
		/// 删除一条数据
		/// </summary>
		public bool Delete()
		{
			//该表无主键信息，请自定义主键/条件字段
			StringBuilder strSql=new StringBuilder();
			strSql.Append("delete from T_PET_PETINFO ");
			strSql.Append(" where ");
			OracleParameter[] parameters = {
			};

			int rows=DbHelperOra.ExecuteSql(strSql.ToString(),parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}


		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public ChinaSoft.Model.Model_T_PET_PETINFO GetModel()
		{
			//该表无主键信息，请自定义主键/条件字段
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select PET_PETINFO_ID,PERMISSION_NO,AREA_GRADE,RFID_DATE,USE_TYPE,COLOR_ID,BREED_ID,FATHER_BREED,MOTHER_BREED,OWNER_ID,AREA_ID,CERT_ORG_ID,BIRTHDAY,CERT_DATE,CHARACTER,HEIGHT,IMMUNITY_NO,IMPORT_ADDRESS,NAME,NOTE,OWNER_TYPE,PET_NO,REG_ORG_ID,RFID,SEX,STATE,TYPE,WEIGHT,REGISTER_NO,ADDRESS,CREATE_TIME,CREATOR_ID,UPDATE_TIME,UPDATOR_ID,PETIMAGE_ID,REGISTER_ID,ISLOGOUT,POLICE_STATION,PETAGE from T_PET_PETINFO ");
			strSql.Append(" where ");
			OracleParameter[] parameters = {
			};

			ChinaSoft.Model.Model_T_PET_PETINFO model=new ChinaSoft.Model.Model_T_PET_PETINFO();
			DataSet ds=DbHelperOra.Query(strSql.ToString(),parameters);
			if(ds.Tables[0].Rows.Count>0)
			{
				if(ds.Tables[0].Rows[0]["PET_PETINFO_ID"]!=null && ds.Tables[0].Rows[0]["PET_PETINFO_ID"].ToString()!="")
				{
					model.PET_PETINFO_ID=ds.Tables[0].Rows[0]["PET_PETINFO_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["PERMISSION_NO"]!=null && ds.Tables[0].Rows[0]["PERMISSION_NO"].ToString()!="")
				{
					model.PERMISSION_NO=ds.Tables[0].Rows[0]["PERMISSION_NO"].ToString();
				}
				if(ds.Tables[0].Rows[0]["AREA_GRADE"]!=null && ds.Tables[0].Rows[0]["AREA_GRADE"].ToString()!="")
				{
					model.AREA_GRADE=decimal.Parse(ds.Tables[0].Rows[0]["AREA_GRADE"].ToString());
				}
				if(ds.Tables[0].Rows[0]["RFID_DATE"]!=null && ds.Tables[0].Rows[0]["RFID_DATE"].ToString()!="")
				{
					model.RFID_DATE=DateTime.Parse(ds.Tables[0].Rows[0]["RFID_DATE"].ToString());
				}
				if(ds.Tables[0].Rows[0]["USE_TYPE"]!=null && ds.Tables[0].Rows[0]["USE_TYPE"].ToString()!="")
				{
					model.USE_TYPE=ds.Tables[0].Rows[0]["USE_TYPE"].ToString();
				}
				if(ds.Tables[0].Rows[0]["COLOR_ID"]!=null && ds.Tables[0].Rows[0]["COLOR_ID"].ToString()!="")
				{
					model.COLOR_ID=ds.Tables[0].Rows[0]["COLOR_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["BREED_ID"]!=null && ds.Tables[0].Rows[0]["BREED_ID"].ToString()!="")
				{
					model.BREED_ID=ds.Tables[0].Rows[0]["BREED_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["FATHER_BREED"]!=null && ds.Tables[0].Rows[0]["FATHER_BREED"].ToString()!="")
				{
					model.FATHER_BREED=decimal.Parse(ds.Tables[0].Rows[0]["FATHER_BREED"].ToString());
				}
				if(ds.Tables[0].Rows[0]["MOTHER_BREED"]!=null && ds.Tables[0].Rows[0]["MOTHER_BREED"].ToString()!="")
				{
					model.MOTHER_BREED=decimal.Parse(ds.Tables[0].Rows[0]["MOTHER_BREED"].ToString());
				}
				if(ds.Tables[0].Rows[0]["OWNER_ID"]!=null && ds.Tables[0].Rows[0]["OWNER_ID"].ToString()!="")
				{
					model.OWNER_ID=ds.Tables[0].Rows[0]["OWNER_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["AREA_ID"]!=null && ds.Tables[0].Rows[0]["AREA_ID"].ToString()!="")
				{
					model.AREA_ID=ds.Tables[0].Rows[0]["AREA_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["CERT_ORG_ID"]!=null && ds.Tables[0].Rows[0]["CERT_ORG_ID"].ToString()!="")
				{
					model.CERT_ORG_ID=ds.Tables[0].Rows[0]["CERT_ORG_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["BIRTHDAY"]!=null && ds.Tables[0].Rows[0]["BIRTHDAY"].ToString()!="")
				{
					model.BIRTHDAY=DateTime.Parse(ds.Tables[0].Rows[0]["BIRTHDAY"].ToString());
				}
				if(ds.Tables[0].Rows[0]["CERT_DATE"]!=null && ds.Tables[0].Rows[0]["CERT_DATE"].ToString()!="")
				{
					model.CERT_DATE=DateTime.Parse(ds.Tables[0].Rows[0]["CERT_DATE"].ToString());
				}
				if(ds.Tables[0].Rows[0]["CHARACTER"]!=null && ds.Tables[0].Rows[0]["CHARACTER"].ToString()!="")
				{
					model.CHARACTER=ds.Tables[0].Rows[0]["CHARACTER"].ToString();
				}
				if(ds.Tables[0].Rows[0]["HEIGHT"]!=null && ds.Tables[0].Rows[0]["HEIGHT"].ToString()!="")
				{
					model.HEIGHT=decimal.Parse(ds.Tables[0].Rows[0]["HEIGHT"].ToString());
				}
				if(ds.Tables[0].Rows[0]["IMMUNITY_NO"]!=null && ds.Tables[0].Rows[0]["IMMUNITY_NO"].ToString()!="")
				{
					model.IMMUNITY_NO=ds.Tables[0].Rows[0]["IMMUNITY_NO"].ToString();
				}
				if(ds.Tables[0].Rows[0]["IMPORT_ADDRESS"]!=null && ds.Tables[0].Rows[0]["IMPORT_ADDRESS"].ToString()!="")
				{
					model.IMPORT_ADDRESS=ds.Tables[0].Rows[0]["IMPORT_ADDRESS"].ToString();
				}
				if(ds.Tables[0].Rows[0]["NAME"]!=null && ds.Tables[0].Rows[0]["NAME"].ToString()!="")
				{
					model.NAME=ds.Tables[0].Rows[0]["NAME"].ToString();
				}
				if(ds.Tables[0].Rows[0]["NOTE"]!=null && ds.Tables[0].Rows[0]["NOTE"].ToString()!="")
				{
					model.NOTE=ds.Tables[0].Rows[0]["NOTE"].ToString();
				}
				if(ds.Tables[0].Rows[0]["OWNER_TYPE"]!=null && ds.Tables[0].Rows[0]["OWNER_TYPE"].ToString()!="")
				{
					model.OWNER_TYPE=ds.Tables[0].Rows[0]["OWNER_TYPE"].ToString();
				}
				if(ds.Tables[0].Rows[0]["PET_NO"]!=null && ds.Tables[0].Rows[0]["PET_NO"].ToString()!="")
				{
					model.PET_NO=ds.Tables[0].Rows[0]["PET_NO"].ToString();
				}
				if(ds.Tables[0].Rows[0]["REG_ORG_ID"]!=null && ds.Tables[0].Rows[0]["REG_ORG_ID"].ToString()!="")
				{
					model.REG_ORG_ID=ds.Tables[0].Rows[0]["REG_ORG_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["RFID"]!=null && ds.Tables[0].Rows[0]["RFID"].ToString()!="")
				{
					model.RFID=ds.Tables[0].Rows[0]["RFID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["SEX"]!=null && ds.Tables[0].Rows[0]["SEX"].ToString()!="")
				{
					model.SEX=ds.Tables[0].Rows[0]["SEX"].ToString();
				}
				if(ds.Tables[0].Rows[0]["STATE"]!=null && ds.Tables[0].Rows[0]["STATE"].ToString()!="")
				{
					model.STATE=ds.Tables[0].Rows[0]["STATE"].ToString();
				}
				if(ds.Tables[0].Rows[0]["TYPE"]!=null && ds.Tables[0].Rows[0]["TYPE"].ToString()!="")
				{
					model.TYPE=decimal.Parse(ds.Tables[0].Rows[0]["TYPE"].ToString());
				}
				if(ds.Tables[0].Rows[0]["WEIGHT"]!=null && ds.Tables[0].Rows[0]["WEIGHT"].ToString()!="")
				{
					model.WEIGHT=decimal.Parse(ds.Tables[0].Rows[0]["WEIGHT"].ToString());
				}
				if(ds.Tables[0].Rows[0]["REGISTER_NO"]!=null && ds.Tables[0].Rows[0]["REGISTER_NO"].ToString()!="")
				{
					model.REGISTER_NO=ds.Tables[0].Rows[0]["REGISTER_NO"].ToString();
				}
				if(ds.Tables[0].Rows[0]["ADDRESS"]!=null && ds.Tables[0].Rows[0]["ADDRESS"].ToString()!="")
				{
					model.ADDRESS=ds.Tables[0].Rows[0]["ADDRESS"].ToString();
				}
				if(ds.Tables[0].Rows[0]["CREATE_TIME"]!=null && ds.Tables[0].Rows[0]["CREATE_TIME"].ToString()!="")
				{
					model.CREATE_TIME=DateTime.Parse(ds.Tables[0].Rows[0]["CREATE_TIME"].ToString());
				}
				if(ds.Tables[0].Rows[0]["CREATOR_ID"]!=null && ds.Tables[0].Rows[0]["CREATOR_ID"].ToString()!="")
				{
					model.CREATOR_ID=ds.Tables[0].Rows[0]["CREATOR_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["UPDATE_TIME"]!=null && ds.Tables[0].Rows[0]["UPDATE_TIME"].ToString()!="")
				{
					model.UPDATE_TIME=DateTime.Parse(ds.Tables[0].Rows[0]["UPDATE_TIME"].ToString());
				}
				if(ds.Tables[0].Rows[0]["UPDATOR_ID"]!=null && ds.Tables[0].Rows[0]["UPDATOR_ID"].ToString()!="")
				{
					model.UPDATOR_ID=ds.Tables[0].Rows[0]["UPDATOR_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["PETIMAGE_ID"]!=null && ds.Tables[0].Rows[0]["PETIMAGE_ID"].ToString()!="")
				{
					model.PETIMAGE_ID=ds.Tables[0].Rows[0]["PETIMAGE_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["REGISTER_ID"]!=null && ds.Tables[0].Rows[0]["REGISTER_ID"].ToString()!="")
				{
					model.REGISTER_ID=ds.Tables[0].Rows[0]["REGISTER_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["ISLOGOUT"]!=null && ds.Tables[0].Rows[0]["ISLOGOUT"].ToString()!="")
				{
					model.ISLOGOUT=decimal.Parse(ds.Tables[0].Rows[0]["ISLOGOUT"].ToString());
				}
				if(ds.Tables[0].Rows[0]["POLICE_STATION"]!=null && ds.Tables[0].Rows[0]["POLICE_STATION"].ToString()!="")
				{
					model.POLICE_STATION=ds.Tables[0].Rows[0]["POLICE_STATION"].ToString();
				}
				if(ds.Tables[0].Rows[0]["PETAGE"]!=null && ds.Tables[0].Rows[0]["PETAGE"].ToString()!="")
				{
					model.PETAGE=decimal.Parse(ds.Tables[0].Rows[0]["PETAGE"].ToString());
				}
				return model;
			}
			else
			{
				return null;
			}
		}

		/// <summary>
		/// 获得数据列表
		/// </summary>
		public DataSet GetList(string strWhere)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select PET_PETINFO_ID,PERMISSION_NO,AREA_GRADE,RFID_DATE,USE_TYPE,COLOR_ID,BREED_ID,FATHER_BREED,MOTHER_BREED,OWNER_ID,AREA_ID,CERT_ORG_ID,BIRTHDAY,CERT_DATE,CHARACTER,HEIGHT,IMMUNITY_NO,IMPORT_ADDRESS,NAME,NOTE,OWNER_TYPE,PET_NO,REG_ORG_ID,RFID,SEX,STATE,TYPE,WEIGHT,REGISTER_NO,ADDRESS,CREATE_TIME,CREATOR_ID,UPDATE_TIME,UPDATOR_ID,PETIMAGE_ID,REGISTER_ID,ISLOGOUT,POLICE_STATION,PETAGE ");
			strSql.Append(" FROM T_PET_PETINFO ");
			if(strWhere.Trim()!="")
			{
				strSql.Append(" where "+strWhere);
			}
			return DbHelperOra.Query(strSql.ToString());
		}

		/// <summary>
		/// 获取记录总数
		/// </summary>
		public int GetRecordCount(string strWhere)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select count(1) FROM T_PET_PETINFO ");
			if(strWhere.Trim()!="")
			{
				strSql.Append(" where "+strWhere);
			}
			object obj = DbHelperSQL.GetSingle(strSql.ToString());
			if (obj == null)
			{
				return 0;
			}
			else
			{
				return Convert.ToInt32(obj);
			}
		}
		/// <summary>
		/// 分页获取数据列表
		/// </summary>
		public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("SELECT * FROM ( ");
			strSql.Append(" SELECT ROW_NUMBER() OVER (");
			if (!string.IsNullOrEmpty(orderby.Trim()))
			{
				strSql.Append("order by T." + orderby );
			}
			else
			{
				strSql.Append("order by T.PET_OWENER_ID desc");
			}
			strSql.Append(")AS Row, T.*  from T_PET_PETINFO T ");
			if (!string.IsNullOrEmpty(strWhere.Trim()))
			{
				strSql.Append(" WHERE " + strWhere);
			}
			strSql.Append(" ) TT");
			strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
			return DbHelperOra.Query(strSql.ToString());
		}

		/*
		/// <summary>
		/// 分页获取数据列表
		/// </summary>
		public DataSet GetList(int PageSize,int PageIndex,string strWhere)
		{
			OracleParameter[] parameters = {
					new OracleParameter(":tblName", OracleType.VarChar, 255),
					new OracleParameter(":fldName", OracleType.VarChar, 255),
					new OracleParameter(":PageSize", OracleType.Number),
					new OracleParameter(":PageIndex", OracleType.Number),
					new OracleParameter(":IsReCount", OracleType.Clob),
					new OracleParameter(":OrderType", OracleType.Clob),
					new OracleParameter(":strWhere", OracleType.VarChar,1000),
					};
			parameters[0].Value = "T_PET_PETINFO";
			parameters[1].Value = "PET_OWENER_ID";
			parameters[2].Value = PageSize;
			parameters[3].Value = PageIndex;
			parameters[4].Value = 0;
			parameters[5].Value = 0;
			parameters[6].Value = strWhere;	
			return DbHelperOra.RunProcedure("UP_GetRecordByPage",parameters,"ds");
		}*/

		#endregion  Method
	}
}

